import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [{
        path: '/',
        name: 'Home',
        component: Home
    },
    {
        path: '/about',
        name: 'About',
        // route level code-splitting
        // this generates a separate chunk (about.[hash].js) for this route
        // which is lazy-loaded when the route is visited.
        component: () =>
            import ( /* webpackChunkName: "about" */ '../views/About.vue')
    },
    {
        path: '/subjectOne',
        component: () =>
            import ('../views/SubjectOne.vue'),
        meta: {
            title: '科目一'
        }
    },
    {
        path: '/subjectTwo',
        component: () =>
            import ('../views/SubjectTwo.vue')
    },
    {
        path: '/subjectThree',
        component: () =>
            import ('../views/SubjectThree.vue')
    },
    {
        path: '/subjectFour',
        component: () =>
            import ('../views/SubjectFour.vue')
    },
    {
        path: '/orderExercise',
        component: () =>
            import ('../views/OrderExercise.vue')
    },
    {
        path: '/changePassword',
        component: () => import('../views/ChangePassword.vue'),
        meta: {
            title: '修改密码'
        }
    },
    {
        path: '/profile',
        component: () => import('../views/Profile.vue'),
        meta: {
            title: '个人信息'
        }
    }
]

const router = new VueRouter({
    routes
})

export default router